//
//  CAtrView.m
//  SinaWebo
//
//  Created by wwj on 16/7/7.
//  Copyright © 2016年 亦心. All rights reserved.
//

#import "CAtrView.h"
#import "PageInfo.h"
#import <Masonry.h>
#import <UIImageView+WebCache.h>

@interface CAtrView ()
@property (weak, nonatomic) IBOutlet UIImageView *atrImg;
@property (weak, nonatomic) IBOutlet UILabel *atrTitle;
@property (weak, nonatomic) IBOutlet UILabel *atrContent;
@property (weak, nonatomic) IBOutlet UILabel *author;
@end

@implementation CAtrView

+ (instancetype)atrView{
    return [[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil].lastObject;
}

- (void)awakeFromNib{
    self.autoresizingMask = UIViewAutoresizingNone;
}

- (void)setPageInfo:(PageInfo *)pageInfo{
    _pageInfo = pageInfo;
    [_atrImg sd_setImageWithURL:[NSURL URLWithString:_pageInfo.type_icon]];
    _atrTitle.text = _pageInfo.content1;
    _atrContent.text = _pageInfo.content2;
    _author.text = _pageInfo.content3;
}

@end
